home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 3
/
Amiga Tools 3.iso
/
programming
/
colpectius1
/
explode.amos
/
explode.amosSourceCode
Wrap
AMOS Source Code
|
1995-09-07
|
1KB
|
53 lines
' Explosion
' ~~~~~~~~~
' by Ben Wyatt, bwyatt@paston.co.uk
' Creates an explosion effect which is actually quite good :-) but slow :-(
' so compile it for that extra burst of speed :)
Set Buffer 50
Degree
Put Key "30"
Input "Particles:";MXPART
Dec MXPART
' A pal/ntsc screen
Screen Open 0,320,256+56*Ntsc,16,Lowres
Screen Display 0,128,37,320,256
Flash Off : Curs Off : Cls 0
' Get those lovely shades of red and yellow
For N=0 To 7
Colour N,(N*2)*256 : Colour N+8,256*14+(N*2)*16
Next N
Dim X(MXPART),Y(MXPART),C(MXPART),XSP(MXPART),YSP(MXPART),SIZE(MXPART)
' Precalc loads of stuff
For N=0 To MXPART
ANG=Rnd(359) : SPD=Rnd(8)
X(N)=160+Sin(ANG)*SPD : Y(N)=96+Cos(ANG)*SPD
C(N)=12+Rnd(3)
XSP(N)=Rnd(10)-5 : YSP(N)=-Rnd(20)
Next N
Double Buffer : Autoback 0
Repeat
CNT=MXPART
For N=0 To MXPART
Add X(N),XSP(N)/4 : Add Y(N),YSP(N)/8
Inc YSP(N)
If Rnd(2)=1 and C(N)>1 : Dec C(N) : End If
ST=3+Rnd(3)
For S=1 To C(N) Step 1
' Turbo/AMCAF users can rem out the next line and unrem the one after
Ink S : Circle X(N),Y(N),(C(N)-S)/ST+1
'Fcircle X(N),Y(N),(C(N)-S)/ST+1,S
Next S
If C(N)<=1 : Dec CNT : End If
Next N
Wait Vbl : Screen Swap : Cls 0
Until Mouse Key>0 or CNT=-1
Edit